package com.fdd.furns.dao.impl;

import com.fdd.furns.dao.BasicDAO;
import com.fdd.furns.dao.OrderItemDAO;
import com.fdd.furns.pojo.OrderItem;

public class OrderItemDAOImpl extends BasicDAO implements OrderItemDAO {
    @Override
    public int saveOrderItem(OrderItem orderItem) {
        String sql = "INSERT INTO order_item(`id`,`name`,`price`,`count`,`total_price`,`order_id`) \n" +
                "VALUES(?,?,?,?,?,?); ";
        return update(sql, orderItem.getId(), orderItem.getName(), orderItem.getPrice(),orderItem.getCount(),
                orderItem.getTotalPrice(), orderItem.getOrderId());
    }
}
